# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: dracorp aka Piotr Rogoza <piotr.r.public at gmail.com>
# Contributor:  TDY <tdy@gmx.com>
# Contributor: François Charette <firmicus ατ gmx δοτ net>

pkgname=perl-par
pkgver=1.019
pkgrel=1
pkgdesc='Perl Archive Toolkit'
arch=('any')
url='https://metacpan.org/release/PAR'
license=('GPL')
depends=('perl-archive-zip' 'perl-par-dist')
options=('!emptydirs' purge)
source=("https://cpan.metacpan.org/authors/id/R/RS/RSCHUPP/PAR-${pkgver}.tar.gz")
b2sums=('63244727e24d9a4848c7155e3e5afe9f911a66f16bebbb11fce575202390a96522bd6f050e92c1265d14a91208c8059efa918b21ec7676f245805324a12875bd')

build() {
  cd PAR-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}
check(){
  cd PAR-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}
package() {
  cd PAR-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
